
import 'package:logmanager/utils/string_ext.dart';

import '../../bean/login_bean.dart';
import '../../net/base_connent.dart';
import '../../net/http_url.dart';

class HomeProvider extends BaseConnent {
  void login(String phone, String? code, {success, fail}) {
    requestHttp<LoginBean>(
      HttpUrl.LOGIN,
      data: {"mobile": phone, "code": code,"platform": 1},
      success: (value) {
        "接口请求成功".logi();
        success(value);
      },
      failMsg: (value) {
        value.toast();
        value.toString().logi();
        fail(value);
      },
      showLoading: true,
    );
  }
}